//
//  NSObject+Property.m
//  高仿暴走斗图
//
//  Created by key on 16/9/21.
//  Copyright © 2016年 huangsongyao. All rights reserved.
//

#import "NSObject+Property.h"

@implementation NSObject (Property)

- (id)getPropertyForKey:(const void *)key
{
    return objc_getAssociatedObject(self, key);
}

- (void)setProperty:(id)property forKey:(const void *)key nonatomic:(objc_AssociationPolicy)nonatomic
{
    [self willChangeValueForKey:(__bridge NSString * _Nonnull)(key)];
    objc_setAssociatedObject(self, key, property, nonatomic);
    [self didChangeValueForKey:(__bridge NSString * _Nonnull)(key)];
}

@end
